package demo07.BatchExecution.object;

public class Hottub {
	boolean on;
	int temperature;//温度

	public Hottub() {
	}

	public void on() {
		on = true;
	}

	public void off() {
		on = false;
	}

	public void circulate() {
		if (on) {
			System.out.println("热水浴缸在冒泡");
		}
	}

	public void jetsOn() {
		if (on) {
			System.out.println("热水浴缸加热打开");
		}
	}

	public void jetsOff() {
		if (on) {
			System.out.println("热水浴缸加热关闭");
		}
	}

	public void setTemperature(int temperature) {
		if (temperature > this.temperature) {
			System.out.println("热水浴缸加热到冒泡 " + temperature + " 摄氏度");
		}
		else {
			System.out.println("热水浴缸冷却到 " + temperature + "  摄氏度");
		}
		this.temperature = temperature;
	}

}
